/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * introduction:
 * @author HelloKun （https://space.bilibili.com/475950146）
 * @brief 智慧终端机器人MRobot -详细功能说明见mrobot.h
 * @function
 *   碰一碰拉起设备页面
 * @copyright Copyright (c) 2022
 */

import app from '@system.app';
import router from '@system.router';
import {getApp} from '../../common.js';
export default {
    data: {
        deviceName: '',
        deviceImg: '',
        productName:'MRobot',
        sessionId: ''
    },
//    JS根据productName显示对应的设备图标
    onInit() {
        this.deviceName = this.$t('strings.device-name');
        this.deviceImg = '/common/img/' + this.productName + ".png";
        getApp(this).Product.productName = this.productName;
        getApp(this).Product.productId = this.productId;
        getApp(this).ConfigParams.sessionId = this.sessionId;
    },
    cancel() {
        app.terminate();
    },
    configNet() {
        router.push({
          uri: 'pages/netconfig/netconfig'
        });
    },
//    去云端控制界面
    web_mqtt()
    {
        router.push({
            uri: 'pages/web_mqtt/web_mqtt'
        })
    }
}